package componentes;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

/**
 * @author Reynald0
 */
public class CompRadioBoton extends JRadioButton
{
   public CompRadioBoton(JPanel pPanel)
   {
      this(pPanel, "");
   }
   
   public CompRadioBoton(JPanel pPanel, String pEtiqueta)
   {
      this(pPanel, pEtiqueta, "");
   }
   
   public CompRadioBoton(JPanel pPanel, String pEtiqueta, ActionListener pAccion)
   {
      this.setText(pEtiqueta);
      this.setAlignmentX(CENTER_ALIGNMENT);
      this.setFocusable(false);
      if (pAccion != null)
         this.addActionListener(pAccion);
      if(pPanel !=null ) 
         pPanel.add(this);
   }
   
   public CompRadioBoton(JPanel pPanel, String pEtiqueta, String pUbicacion)
   {
      this.setText(pEtiqueta);
      this.setAlignmentX(CENTER_ALIGNMENT);
      this.setFocusable(false);
      if(pPanel !=null ) 
         pPanel.add(this, pUbicacion);
   }
   
   public CompRadioBoton(JPanel pPanel, String pEtiqueta, String pUbicacion, ActionListener pAccion)
   {
      this.setText(pEtiqueta);
      this.setAlignmentX(CENTER_ALIGNMENT);
      this.setFocusable(false);
      if (pAccion != null)
         this.addActionListener(pAccion);
      if(pPanel !=null ) 
         pPanel.add(this, pUbicacion);
   }
   
}
